package com.toggery.POS.dao;

import com.toggery.POS.entity.Orderdetail;
import com.toggery.POS.entity.OrderdetailExample;
import com.toggery.POS.entity.OrderdetailRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderdetailMapper {
    long countByExample(OrderdetailExample example);

    int deleteByExample(OrderdetailExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Orderdetail record);

    int insertSelective(Orderdetail record);

    List<Orderdetail> selectByExample(OrderdetailExample example);

    Orderdetail selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Orderdetail record, @Param("example") OrderdetailExample example);

    int updateByExample(@Param("record") Orderdetail record, @Param("example") OrderdetailExample example);

    int updateByPrimaryKeySelective(Orderdetail record);

    int updateByPrimaryKey(Orderdetail record);
    @Select({
            "select * from orderdetail"
    })
    List<Orderdetail> findAll();

    @Select({
            "select * from orderdetail where orderId=#{orderId,jdbcType=INTEGER}"
    })
    List<Orderdetail> findAllWithinOrder(Integer orderId);
}